Kanzi Connect 3.9.10
kanzi::connect::RuntimeDataObject Class Reference

RuntimeDataObject is a base class for hierarchical runtime data. More...

#include <runtimedataobject.hpp>

Inheritance diagram for kanzi::connect::RuntimeDataObject:
kanzi::connect::RuntimeDataObjectList kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >

Public Types

typedef ChildContainer::const_iterator ChildConstIterator
 
typedef ChildContainer::const_reverse_iterator ChildConstReverseIterator
 
typedef vector< RuntimeDataObjectSharedPtrChildContainer
 Iterators for children.
 
typedef function< void(RuntimeDataObject *self) ModifiedFunction)
 Callback function type for change subscriptions.
 
typedef shared_ptr< void > ModifiedSubscriptionToken
 Token type that can be used to identify the change subscription.
 
enum class  Persistence { NON_PERSISTENT , PERSISTENT }
 Is the runtime data object persistent or not. More...
 
enum  Type {
  Object = 0 , Integer = 1 , Real = 2 , Bool = 3 ,
  String = 4 , List = 6 , Unknown = 100
}
 Type enumerations for different data object types. More...
 

Public Member Functions

void addChild (const RuntimeDataObjectSharedPtr &child)
 Adds data object as child of this object.
 
ModifiedSubscriptionToken addModifiedNotificationHandler (ModifiedFunction callback)
 Allows to subscribe to modifications in this data context.
 
ChildConstIterator beginChildren () const
 Returns iterator to start of the child container.
 
template<typename _ToClass >
shared_ptr< _ToClass > castTo ()
 Cast this object to specific type.
 
virtual RuntimeDataObjectSharedPtr clone ()
 Clones an object and creates exact duplicate of it.
 
void copyDataFrom (RuntimeDataObject &from)
 Copies basic data from provided object.
 
virtual bool copyValueFrom (RuntimeDataObjectSharedPtr other)
 Copies a value from other object.
 
bool createChild (const string &name, const RuntimeDataObject::Type dataType, const string &serializedDefaultValue, const bool persistent, const int flags, const persistence::SettingFactory *settingFactory)
 Create a child under this runtime data object.
 
bool createChildRecursive (const string &path, RuntimeDataObject::Type dataType, const string &serializedDefaultValue, const bool persistent, const int flags, const persistence::SettingFactory *settingFactory)
 Create a child data object in the correct place in hierarchy specified by path.
 
RuntimeDataObjectSharedPtr createPathObjects (const string &path, const persistence::SettingFactory *settingFactory)
 Create objects enough to have the given path in the runtime data and return the leaf object All created objects are of Type::Object.
 
ChildConstIterator endChildren () const
 Returns iterator in the end of the child container.
 
virtual bool equals (RuntimeDataObjectSharedPtr other)
 Compares objects and returns true if objects, including childs, are equal.
 
RuntimeDataObjectSharedPtr findChild (const string &name)
 Tries to find a child with given name.
 
template<typename _T >
shared_ptr< _T > findChild (const string &name)
 Retrieve a typed children with specific name.
 
RuntimeDataObjectSharedPtr findChild (uint32_t hash)
 Tries to find a child with given name hash code.
 
template<typename _T >
shared_ptr< _T > findChild (uint32_t hash)
 Retrieve a typed children with specific name hash code.
 
RuntimeDataObjectSharedPtr findChildRecursive (const string &path, bool passLists=true)
 Locates childs recursively.
 
template<typename _T >
shared_ptr< _T > findChildRecursive (const string &path, bool passLists=true)
 Locates childs recursively.
 
bool generatesGetter () const
 Retrieve getter generation status.
 
RuntimeDataObjectSharedPtr getChild (size_t index) const
 Retrieves a child object in given index.
 
template<typename _T >
shared_ptr< _T > getChild (size_t index) const
 
size_t getChildCount () const
 Retrieves the count of child objects in this data object.
 
size_t getChildIndex (const RuntimeDataObject &child) const
 Retrieves the index of a child data object.
 
virtual string getDefaultValueStr () const
 Virtual function which exists in this base class but should never be used. This is overridden in classes where its appropriate.
 
void getFreeformProperties (vector< pair< string, string > > &output)
 Get list of the free form properties defined for the object output The freeform properties will be copied here,.
 
int getIntProperty (const string &name, int defaultValue=0) const
 Retrieve int property value.
 
string getName () const
 Allows to retrieve the name of the object.
 
virtual uint32_t getNameHash ()
 retrieve hash code for the name portion of node
 
string getNameOverride () const
 Retrieve the overriden name.
 
const string & getPath () const
 
virtual string getSerializedValue () const
 Get the runtimedata object value in serialized format.
 
string getStringProperty (const string &name, const string defaultValue="") const
 Retrieve string property value.
 
virtual Type getType () const
 Allows to retrieve the type of the object.
 
template<typename _ToClass >
shared_ptr< _ToClass > getUIDelegate ()
 Retrieve UI Delegate and cast it to approriate type.
 
ModifiedSubscriptionToken getUIDelegateModificationHandlerToken () const
 Retrieve UI Delegate specific modification handlers registration token.
 
bool getWritable () const
 Retrieve writable status.
 
bool hasChild (const RuntimeDataObject &child) const
 Checks whether or not the child exists.
 
bool hasProperty (const string &name)
 Checks whether there is a property with given name.
 
virtual void notifyModified (RuntimeDataObject *object=0)
 Triggers modification procedure in this data context, which invokes the subscriptions.
 
virtual void removeAllChildren ()
 Removes all children.
 
virtual void removeChild (const RuntimeDataObject &child)
 Removes a child object from list of childs.
 
virtual bool removeChild (const string &name)
 Remove specified child of this object.
 
virtual void removeChild (size_t index)
 Removes a child object in given index.
 
bool removeChildRecursive (const string &path)
 Remove specified child and all elements in the path that would become empty.
 
void removeModifiedNotificationHandler (ModifiedSubscriptionToken token)
 Allows to unsubscribe from modifications in this data context.
 
void removeProperty (const string &name)
 Removes a property with specific name.
 
 RuntimeDataObject (ConnectDomainSharedPtr domain, const string &name, const string nameOverride="")
 Standard constructor.
 
 RuntimeDataObject (ConnectDomainSharedPtr domain, const string &path, const string &name, const string nameOverride)
 Standard constructor.
 
bool sendsEvent () const
 Retrieve notifier event generation status.
 
void setGenerateGetter (bool creteGetter)
 Set generate getter flag.
 
void setName (const string &value)
 Sets the name of the object.
 
void setNameOverride (const string &value)
 Sets the overriden name of the object.
 
void setProperty (const string &name, const string &value)
 Sets a local property - this information is not serialized.
 
void setProperty (const string &name, int value)
 Sets a local property - this information is not serialized.
 
void setSendsEvent (bool createEventOnChange)
 Set generate notifier event flag.
 
bool setSerializedValue (const string &serializedValue)
 Set the value for this data object, if this is not typed or list type then this will fail.
 
void setUIDelegateModificationHandlerToken (ModifiedSubscriptionToken token)
 Store UI Delegate modification handler handle.
 
void setUIDelegete (shared_ptr< DataObject > deleg)
 Configures UI Delegate object for this content object.
 
void setWritable (bool writable)
 Set writable flag.
 
virtual ~RuntimeDataObject ()
 C++ destructor.
 

Static Public Member Functions

static bool isFreeformProperty (const string &propertyName)
 Checks whether the named property is one of the defined properties or not.
 
static Type str2Type (const string &str)
 Convert a string to Type.
 
static string type2Str (const Type type)
 Convert the type enumeration value to human readable string.
 

Protected Types

typedef unordered_map< RuntimeDataObjectSharedPtr, ModifiedSubscriptionTokenChildrenSubscriptionContainer
 
enum  PrivateRuntimeFlags { NONE = 0x0 , HAS_SETTER = 0x0001 , HAS_NOTIFIER = 0x0010 , HAS_GETTER = 0x0100 }
 

Protected Attributes

ChildContainer m_children
 Children of the data object.
 
ChildrenSubscriptionContainer m_childrenSubscriptionTokens
 
ConnectDomainSharedPtr m_domain
 The connect domain this dataobject is bound to.
 
int m_flags
 
string m_name
 Name of the object.
 
uint32_t m_nameHash
 Hash code of the name.
 
string m_nameOverride
 UI Override for the name.
 
string m_path
 Contains the full path of the object and its parents.
 
optional< unordered_map< string, string > > m_properties
 Free form properties set for the object.
 
Type m_type
 Possible type.
 
weak_ptr< DataObject > m_UIDelegate
 UI class, kept as unknown here, just a pointer.
 
ModifiedSubscriptionToken m_UIDelegateModificationToken
 Token for modification registrations of UI Delegate.
 

Detailed Description

RuntimeDataObject is a base class for hierarchical runtime data.

Member Typedef Documentation

◆ ChildConstIterator

typedef ChildContainer::const_iterator kanzi::connect::RuntimeDataObject::ChildConstIterator

◆ ChildConstReverseIterator

typedef ChildContainer::const_reverse_iterator kanzi::connect::RuntimeDataObject::ChildConstReverseIterator

◆ ChildContainer

◆ ChildrenSubscriptionContainer

◆ ModifiedFunction

typedef function<void(RuntimeDataObject* self) kanzi::connect::RuntimeDataObject::ModifiedFunction)

Callback function type for change subscriptions.

◆ ModifiedSubscriptionToken

Token type that can be used to identify the change subscription.

Member Enumeration Documentation

◆ Persistence

Is the runtime data object persistent or not.

Enumerator
NON_PERSISTENT 
PERSISTENT 

◆ PrivateRuntimeFlags

Enumerator
NONE 
HAS_SETTER 
HAS_NOTIFIER 

The object value externally writable (over the net), create method to write the value.

HAS_GETTER 

Event is automatically created when value chnages.

◆ Type

Type enumerations for different data object types.

Enumerator
Object 
Integer 
Real 
Bool 
String 
List 
Unknown 

Constructor & Destructor Documentation

◆ RuntimeDataObject() [1/2]

kanzi::connect::RuntimeDataObject::RuntimeDataObject ( ConnectDomainSharedPtr domain,
const string & name,
const string nameOverride = "" )
explicit

Standard constructor.

Parameters
domainconnect domain
nameName of the data object.
nameOverrideoverridden name of the object.

◆ RuntimeDataObject() [2/2]

kanzi::connect::RuntimeDataObject::RuntimeDataObject ( ConnectDomainSharedPtr domain,
const string & path,
const string & name,
const string nameOverride )
explicit

Standard constructor.

Parameters
domainconnect domain
pathPath that contains names of the parents separated with '.'
nameName of the data object.
nameOverrideoverridden name of the object.

◆ ~RuntimeDataObject()

virtual kanzi::connect::RuntimeDataObject::~RuntimeDataObject ( )
virtual

C++ destructor.

Member Function Documentation

◆ addChild()

void kanzi::connect::RuntimeDataObject::addChild ( const RuntimeDataObjectSharedPtr & child)

Adds data object as child of this object.

Parameters
childChild object to add.

◆ addModifiedNotificationHandler()

ModifiedSubscriptionToken kanzi::connect::RuntimeDataObject::addModifiedNotificationHandler ( ModifiedFunction callback)

Allows to subscribe to modifications in this data context.

Parameters
callbackCallback that is invoked when a change occurs in this data context.
Returns
Token that can be used to identify and remove given subscription.

◆ beginChildren()

ChildConstIterator kanzi::connect::RuntimeDataObject::beginChildren ( ) const

Returns iterator to start of the child container.

Returns
Iterator at the beginning of the container.

◆ castTo()

template<typename _ToClass >
shared_ptr< _ToClass > kanzi::connect::RuntimeDataObject::castTo ( )
inline

Cast this object to specific type.

◆ clone()

virtual RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::clone ( )
virtual

Clones an object and creates exact duplicate of it.

How ever, possible modification subscriptions are not duplicated.

Returns
newly allocated object with exactly same contents.

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >, and kanzi::connect::RuntimeDataObjectList.

◆ copyDataFrom()

void kanzi::connect::RuntimeDataObject::copyDataFrom ( RuntimeDataObject & from)

Copies basic data from provided object.

Parameters
fromwhere the copying is done from.

◆ copyValueFrom()

virtual bool kanzi::connect::RuntimeDataObject::copyValueFrom ( RuntimeDataObjectSharedPtr other)
virtual

Copies a value from other object.

Parameters
otherthe object where-from copying takes place
Returns
true if copied successfully.

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >.

◆ createChild()

bool kanzi::connect::RuntimeDataObject::createChild ( const string & name,
const RuntimeDataObject::Type dataType,
const string & serializedDefaultValue,
const bool persistent,
const int flags,
const persistence::SettingFactory * settingFactory )

Create a child under this runtime data object.

Parameters
nameThe name of the child
dataTypeThe data type of the child
serializedDefaultValueThe default value in serialized format, to be deserialized based on given data type
persistentIs the element persisted over reboots
flagsShould the element have modifier method (used by code generation only)
settingFactoryUsed to create children with persistent values
Returns
True if the child was successfully added

◆ createChildRecursive()

bool kanzi::connect::RuntimeDataObject::createChildRecursive ( const string & path,
RuntimeDataObject::Type dataType,
const string & serializedDefaultValue,
const bool persistent,
const int flags,
const persistence::SettingFactory * settingFactory )

Create a child data object in the correct place in hierarchy specified by path.

Parameters
pathSpecifies the location of the child, if needed then intermediate layers are created on the way
dataTypeThe data type of the child
serializedDefaultValueThe default value in serialized format, to be deserialized based on given data type
persistentIs the element persisted over reboots
flagsShould the element have modifier method (used by code generation only)
settingFactoryUsed to create children with persistent values
Returns
True if the child was successfully added

◆ createPathObjects()

RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::createPathObjects ( const string & path,
const persistence::SettingFactory * settingFactory )

Create objects enough to have the given path in the runtime data and return the leaf object All created objects are of Type::Object.

Parameters
pathIdentifies the objects to create
settingFactoryUsed to create children with persistent values (passed to future children, not used directly)
Returns
The created leaf object which can be used as parent for future children

◆ endChildren()

ChildConstIterator kanzi::connect::RuntimeDataObject::endChildren ( ) const

Returns iterator in the end of the child container.

Returns
Iterator in the end of the container.

◆ equals()

virtual bool kanzi::connect::RuntimeDataObject::equals ( RuntimeDataObjectSharedPtr other)
virtual

Compares objects and returns true if objects, including childs, are equal.

Parameters
otherwhere to compare
Returns
true if equal.

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >, and kanzi::connect::RuntimeDataObjectList.

◆ findChild() [1/4]

RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::findChild ( const string & name)

Tries to find a child with given name.

Returns
Child object that was found, or empty pointer if there is no such child.

◆ findChild() [2/4]

template<typename _T >
shared_ptr< _T > kanzi::connect::RuntimeDataObject::findChild ( const string & name)
inline

Retrieve a typed children with specific name.

Parameters
namethe name of children to look for
Returns
typed shared pointer or empty pointer.

◆ findChild() [3/4]

RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::findChild ( uint32_t hash)

Tries to find a child with given name hash code.

Parameters
hashthe hashcode to be used in lookup.

◆ findChild() [4/4]

template<typename _T >
shared_ptr< _T > kanzi::connect::RuntimeDataObject::findChild ( uint32_t hash)
inline

Retrieve a typed children with specific name hash code.

Parameters
hashThe hash of the children to look for.
Returns
typed shared pointer or empty pointer.

◆ findChildRecursive() [1/2]

RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::findChildRecursive ( const string & path,
bool passLists = true )

Locates childs recursively.

Parameters
pathfull path to object, items separated with dot ('.'). i.e. Engine.Speed
passListswhether to go over lists.
Returns
Object that was found or empty pointer if path could not be resolved.

◆ findChildRecursive() [2/2]

template<typename _T >
shared_ptr< _T > kanzi::connect::RuntimeDataObject::findChildRecursive ( const string & path,
bool passLists = true )
inline

Locates childs recursively.

Parameters
pathfull path to object, items separated with dot ('.'). i.e. Engine.Speed
passListswhether to go over lists.
Returns
Object that was found or empty pointer if path could not be resolved.

◆ generatesGetter()

bool kanzi::connect::RuntimeDataObject::generatesGetter ( ) const

Retrieve getter generation status.

Returns
getter generation status.

◆ getChild() [1/2]

RuntimeDataObjectSharedPtr kanzi::connect::RuntimeDataObject::getChild ( size_t index) const

Retrieves a child object in given index.

Returns
Child data object in given index.

◆ getChild() [2/2]

template<typename _T >
shared_ptr< _T > kanzi::connect::RuntimeDataObject::getChild ( size_t index) const
inline

◆ getChildCount()

size_t kanzi::connect::RuntimeDataObject::getChildCount ( ) const

Retrieves the count of child objects in this data object.

Returns
Child object count.

◆ getChildIndex()

size_t kanzi::connect::RuntimeDataObject::getChildIndex ( const RuntimeDataObject & child) const

Retrieves the index of a child data object.

Returns
Index of the item in question, throws exception if there is no such child.

◆ getDefaultValueStr()

virtual string kanzi::connect::RuntimeDataObject::getDefaultValueStr ( ) const
inlinevirtual

Virtual function which exists in this base class but should never be used. This is overridden in classes where its appropriate.

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >.

◆ getFreeformProperties()

void kanzi::connect::RuntimeDataObject::getFreeformProperties ( vector< pair< string, string > > & output)

Get list of the free form properties defined for the object output The freeform properties will be copied here,.

See also
RuntimeDataObject::isFreeformProperty

◆ getIntProperty()

int kanzi::connect::RuntimeDataObject::getIntProperty ( const string & name,
int defaultValue = 0 ) const

Retrieve int property value.

Parameters
namethe name of the property
defaultValuethe value for the property
Returns
retrieved value

◆ getName()

string kanzi::connect::RuntimeDataObject::getName ( ) const

Allows to retrieve the name of the object.

Returns
Returns the name of the object.

◆ getNameHash()

virtual uint32_t kanzi::connect::RuntimeDataObject::getNameHash ( )
virtual

retrieve hash code for the name portion of node

Returns
CRC32 hash.

◆ getNameOverride()

string kanzi::connect::RuntimeDataObject::getNameOverride ( ) const

Retrieve the overriden name.

Returns
the overriden name. if not specified then returns same as getName

◆ getPath()

const string & kanzi::connect::RuntimeDataObject::getPath ( ) const

◆ getSerializedValue()

virtual string kanzi::connect::RuntimeDataObject::getSerializedValue ( ) const
virtual

Get the runtimedata object value in serialized format.

Returns
The value, empty string if object has no value

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >.

◆ getStringProperty()

string kanzi::connect::RuntimeDataObject::getStringProperty ( const string & name,
const string defaultValue = "" ) const

Retrieve string property value.

Parameters
namethe name of the property
defaultValuethe value for the property
Returns
retrieved value

◆ getType()

virtual Type kanzi::connect::RuntimeDataObject::getType ( ) const
inlinevirtual

Allows to retrieve the type of the object.

Returns
Type enumeration of the object.

Reimplemented in kanzi::connect::RuntimeDataObjectTyped< DataType, DataTypeEnum >, and kanzi::connect::RuntimeDataObjectList.

◆ getUIDelegate()

template<typename _ToClass >
shared_ptr< _ToClass > kanzi::connect::RuntimeDataObject::getUIDelegate ( )
inline

Retrieve UI Delegate and cast it to approriate type.

Note
This is Kanzi Connect frameworks internal use only.
Returns
caseted type or null.

◆ getUIDelegateModificationHandlerToken()

ModifiedSubscriptionToken kanzi::connect::RuntimeDataObject::getUIDelegateModificationHandlerToken ( ) const

Retrieve UI Delegate specific modification handlers registration token.

Note
This is Kanzi Connect frameworks internal use only.
Returns
registration token.

◆ getWritable()

bool kanzi::connect::RuntimeDataObject::getWritable ( ) const

Retrieve writable status.

Returns
writable status.

◆ hasChild()

bool kanzi::connect::RuntimeDataObject::hasChild ( const RuntimeDataObject & child) const

Checks whether or not the child exists.

Returns
true if there is such child, otherwise false.

◆ hasProperty()

bool kanzi::connect::RuntimeDataObject::hasProperty ( const string & name)

Checks whether there is a property with given name.

Parameters
namethe name to check.
Returns
true if property with name exists.

◆ isFreeformProperty()

static bool kanzi::connect::RuntimeDataObject::isFreeformProperty ( const string & propertyName)
static

Checks whether the named property is one of the defined properties or not.

Parameters
propertyNameIdentifies what kind of property is
Returns
True if property is not one of the specially defined ones

◆ notifyModified()

virtual void kanzi::connect::RuntimeDataObject::notifyModified ( RuntimeDataObject * object = 0)
virtual

Triggers modification procedure in this data context, which invokes the subscriptions.

Should be called by derived classes whenever the value of the object is changed.

◆ removeAllChildren()

virtual void kanzi::connect::RuntimeDataObject::removeAllChildren ( )
virtual

Removes all children.

Reimplemented in kanzi::connect::RuntimeDataObjectList.

◆ removeChild() [1/3]

virtual void kanzi::connect::RuntimeDataObject::removeChild ( const RuntimeDataObject & child)
virtual

Removes a child object from list of childs.

Parameters
childChild object to remove.

Reimplemented in kanzi::connect::RuntimeDataObjectList.

◆ removeChild() [2/3]

virtual bool kanzi::connect::RuntimeDataObject::removeChild ( const string & name)
virtual

Remove specified child of this object.

Parameters
nameIdentifies the child to remove
Returns
True if a child is found and removed

◆ removeChild() [3/3]

virtual void kanzi::connect::RuntimeDataObject::removeChild ( size_t index)
virtual

Removes a child object in given index.

Parameters
indexThe index of the child object to remove.

Reimplemented in kanzi::connect::RuntimeDataObjectList.

◆ removeChildRecursive()

bool kanzi::connect::RuntimeDataObject::removeChildRecursive ( const string & path)

Remove specified child and all elements in the path that would become empty.

Parameters
pathIdentifies the element to remove
Returns
True if at least one element was removed

◆ removeModifiedNotificationHandler()

void kanzi::connect::RuntimeDataObject::removeModifiedNotificationHandler ( ModifiedSubscriptionToken token)

Allows to unsubscribe from modifications in this data context.

Parameters
tokenToken to identify the subscription that should be removed.

◆ removeProperty()

void kanzi::connect::RuntimeDataObject::removeProperty ( const string & name)

Removes a property with specific name.

Parameters
namethe name of the property to remove.

◆ sendsEvent()

bool kanzi::connect::RuntimeDataObject::sendsEvent ( ) const

Retrieve notifier event generation status.

Returns
notifier event generation status.

◆ setGenerateGetter()

void kanzi::connect::RuntimeDataObject::setGenerateGetter ( bool creteGetter)

Set generate getter flag.

param createGetter if true, the object will have a direct method to read its value

◆ setName()

void kanzi::connect::RuntimeDataObject::setName ( const string & value)

Sets the name of the object.

Parameters
valueNew name that is assigned to object.

◆ setNameOverride()

void kanzi::connect::RuntimeDataObject::setNameOverride ( const string & value)

Sets the overriden name of the object.

Parameters
valueNew name that is assigned to object.

◆ setProperty() [1/2]

void kanzi::connect::RuntimeDataObject::setProperty ( const string & name,
const string & value )

Sets a local property - this information is not serialized.

Parameters
namename of the property
valuethe value for the property.

◆ setProperty() [2/2]

void kanzi::connect::RuntimeDataObject::setProperty ( const string & name,
int value )

Sets a local property - this information is not serialized.

Parameters
namethe name of the property
valuethe value of the property

◆ setSendsEvent()

void kanzi::connect::RuntimeDataObject::setSendsEvent ( bool createEventOnChange)

Set generate notifier event flag.

param createEventOnChange if true, the object will emit an event when its value changes

◆ setSerializedValue()

bool kanzi::connect::RuntimeDataObject::setSerializedValue ( const string & serializedValue)

Set the value for this data object, if this is not typed or list type then this will fail.

Parameters
serializedValueContains the data value to set in serialized format
Returns
False if fails due to object type or data deserialization failure

◆ setUIDelegateModificationHandlerToken()

void kanzi::connect::RuntimeDataObject::setUIDelegateModificationHandlerToken ( ModifiedSubscriptionToken token)

Store UI Delegate modification handler handle.

Note
This is Kanzi Connect frameworks internal use only.
Parameters
tokenthe token to store

◆ setUIDelegete()

void kanzi::connect::RuntimeDataObject::setUIDelegete ( shared_ptr< DataObject > deleg)
inline

Configures UI Delegate object for this content object.

Note
This is Kanzi Connect frameworks internal use only.
Parameters
delegdelegate object

◆ setWritable()

void kanzi::connect::RuntimeDataObject::setWritable ( bool writable)

Set writable flag.

Parameters
writablestate

◆ str2Type()

static Type kanzi::connect::RuntimeDataObject::str2Type ( const string & str)
static

Convert a string to Type.

Parameters
strContains the data type, interchangeable with type2Str
Returns
The identified Type, Unknown if not identified

◆ type2Str()

static string kanzi::connect::RuntimeDataObject::type2Str ( const Type type)
static

Convert the type enumeration value to human readable string.

Parameters
typeThe enumeration value to convert
Returns
string containing the value in human readable form

Member Data Documentation

◆ m_children

ChildContainer kanzi::connect::RuntimeDataObject::m_children
protected

Children of the data object.

◆ m_childrenSubscriptionTokens

ChildrenSubscriptionContainer kanzi::connect::RuntimeDataObject::m_childrenSubscriptionTokens
protected

◆ m_domain

ConnectDomainSharedPtr kanzi::connect::RuntimeDataObject::m_domain
protected

The connect domain this dataobject is bound to.

◆ m_flags

int kanzi::connect::RuntimeDataObject::m_flags
protected

◆ m_name

string kanzi::connect::RuntimeDataObject::m_name
protected

Name of the object.

◆ m_nameHash

uint32_t kanzi::connect::RuntimeDataObject::m_nameHash
protected

Hash code of the name.

◆ m_nameOverride

string kanzi::connect::RuntimeDataObject::m_nameOverride
protected

UI Override for the name.

◆ m_path

string kanzi::connect::RuntimeDataObject::m_path
protected

Contains the full path of the object and its parents.

◆ m_properties

optional<unordered_map<string, string> > kanzi::connect::RuntimeDataObject::m_properties
protected

Free form properties set for the object.

◆ m_type

Type kanzi::connect::RuntimeDataObject::m_type
protected

Possible type.

◆ m_UIDelegate

weak_ptr<DataObject> kanzi::connect::RuntimeDataObject::m_UIDelegate
protected

UI class, kept as unknown here, just a pointer.

◆ m_UIDelegateModificationToken

ModifiedSubscriptionToken kanzi::connect::RuntimeDataObject::m_UIDelegateModificationToken
protected

Token for modification registrations of UI Delegate.


The documentation for this class was generated from the following file: